# App.py 
# VHP-2, slawek@rozbicki.eu

from Record import Record

class App:
	u"App"
	def __init__(self, record):
		u""
		self.rec_table = []
		self.vhost = record['vhost']
		self.Append(record)
        def __repr__(self):
                return u"%s (%d)" % (self.vhost, len(self.rec_table))
	def Append(self, record):
		u""
		line = Record(record)
		self.rec_table.append(line)
	def Name(self):
		return "%s" % self.vhost
	def ShowTable(self): #debug/reporting
		print "* %s records (%d):" % (self.vhost, len(self.rec_table))
		for i in range(len(self.rec_table)):
			r = self.rec_table[i]		
			print "%d: %s <- %s:%d" % (i+1, r.url, r.src_ip, r.src_port)
 

